package xhwl.hmo.mall.http.api;


import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.hmo.mall.Constant;
import xhwl.hmo.mall.http.ApiService;
import xhwl.retrofitrx.BaseApi;

/**
 * Created by admin on 2017/1/16.
 */

public class FeedBackApi extends BaseApi {
    FeedBackReq req;

    public FeedBackApi(String opinion,String member_mobile) {
        req = new FeedBackReq(opinion,member_mobile);
    }

    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).feedback(requestBody);
    }

    public class FeedBackReq {
        /**
         * client_type : 800
         * opinion : 测试生死
         */

        private String member_mobile;
        private String client_type;
        private String opinion;

        public FeedBackReq(String opinion,String member_mobile) {
            this.member_mobile = member_mobile;
            this.client_type = Constant.CLIENT_TYPE;
            this.opinion = opinion;
        }
    }
}
